﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;

namespace DVK.SP2007.Constants
{
    /// <summary>
    /// General constants for SharePoint integration with DVK.
    /// </summary>
    public static class General
    {
        public const string DDOCExtension = ".ddoc";
        public const string InboxOutboxFilenameDateTimePattern = "HHmm_ddyyyy_";
        public const string DvkResxFileName = "Dvk.resx";
        public const int MaxTargetUrlLength = 256;
        public const int MaxTargetFileNameLength = 128;
    }

    /// <summary>
    /// Mainly list urls and partial urls used to get the SPList object.
    /// </summary>
    public static class Urls
    {
        public const string ListAllItemsPart = "AllItems.aspx";
        public const string ListFormsAllItemsPart = "Forms/" + ListAllItemsPart;
        public const string ListSettings = "/" + Lists.DvkSettings.Url + "/" + ListAllItemsPart;
        public const string ListOrganisations = "/" + Lists.DvkOrganisations.Url + "/" + ListAllItemsPart;
        public const string ListInbox = "/" + Lists.DvkInbox.Url + "/" + ListFormsAllItemsPart;
        public const string ListOutbox = "/" + Lists.DvkOutbox.Url + "/" + ListFormsAllItemsPart;
        public const string ListDvkMessageArchive = "/" + Lists.DvkArchive.Url + "/" + ListFormsAllItemsPart;
        public const string ListDvkMessageRecipients = "/" + Lists.DvkOrganisationRecipients.Url + "/" + ListAllItemsPart;
        public const string ListMetadataMapping = "/" + Lists.DvkMetadataMapping.Url + "/" + ListAllItemsPart;
        public const string ListUserInformation = "/_catalogs/users";
    }

    /// <summary>
    /// All DVK setting names.
    /// </summary>
    public static class Settings
    {
        public const string DvkUKDatabaseConnectionString = "DvkUKDatabaseConnectionString";
        public const string DvkMoveToDocumentLibaryPaths = "DvkMoveToDocumentLibaryPaths";
        public const string DvkFolders = "DVKFolders";
        public const string DvkDokumendiliigid = "DVKDokumendiliigid";
        public const string DvkPersonMetadataFieldsMapping = "DvkPersonMetadataFieldsMapping";
        public const string DvkSenderOrganisationInfo = "DvkSenderOrganisationInfo";
        public const string ArchiveItemsOlderThanInDays = "ArchiveItemsOlderThanInDays";
        public const string DvkFieldsForMapping = "DvkFieldsForMapping";
        public const string SPFieldGroupFilter = "SPFieldGroupFilter";
        public const string DvkSiteUrl = "SiteUrl";
        public const string FilenameFilter = "FilenameFilter";
        public const string JobsLogSourceLevel = "LogSourceLevel";
    }

    /// <summary>
    /// All query string parameter names used.
    /// </summary>
    public static class Params
    {
        public const string QueryStringParameterListId = "List";
        public const string QueryStringParameterItemId = "Item";
        public const string QueryStringParameterItemUrl = "ItemUrl";
        public const string QueryStringParameterSource = "Source";
    }

    /// <summary>
    /// All cached object key names.
    /// </summary>
    public static class Caching
    {
        public const string DvkCapableOrganisationList = "CachedDvkCapableOrganisationList";
        public const string DvkOrganisationListitems = "CachedDvkOrganisationListitems";
        public const string DvkFieldsForMappingList = "CachedDvkFieldsForMappingList";
        public const string WebSPFieldsForMappingList = "CachedWebSPFieldsForMappingList";
        public const string JobsResources = "CachedJobsResources";
        public const string DvkMetadataMappingsList = "CachedDvkMetadataMappingsList";
    }


    /// <summary>
    /// All field names that are not site columns, but used somewhere.
    /// </summary>
    public static class FieldNames
    {
        public const string SPFileContentTypeIdProperty = "ContentTypeId";
        public const string ItemFieldCreatedDate = "Created";
        public const string ItemFieldModified = "Modified";
    }

    /// <summary>
    /// All logger sources (event log source names) from DVK.SP2007 sharepoint project.
    /// </summary>
    public static class LoggingSources
    {
        /// <summary>
        /// Logging from the SendReceiveJob class.
        /// </summary>
        public const string SendReceiveJob = "DVK.SP2007.SendReceiveJob";
        /// <summary>
        /// Logging from the SynchronizeOrganisationsJob class.
        /// </summary>
        public const string SynchronizeOrganisationsJob = "DVK.SP2007.SynchronizeOrganisationsJob";
        /// <summary>
        /// Logging from the DvkMessagesArchiveJob class.
        /// </summary>
        public const string DvkMessagesArchiveJob = "DVK.SP2007.DvkMessagesArchiving";

        /// <summary>
        /// Logging from Timer JobsFeatureReceiver class.
        /// </summary>
        public const string TimerJobsFeatureReceiver = "TimerJobsFeatureReceiver";
        /// <summary>
        /// Logging from the GlobalResourcesManager class.
        /// </summary>
        public const string GlobalResourcesManager = "DVK.SP2007.GlobalResourcesManager";

        /// <summary>
        /// Logging from within the DvkFeatureReceiver.
        /// </summary>
        public const string DvkFeatureReceiver = "DVK.SP2007.DvkFeatureReceiver";
    }
}
